Conversation
Stretch has been EOL since 2022. Bookworm is the current Debian stable, and is what Odoo 19 officially targets (along with Noble). Changes: - FROM debian:stretch-slim -> debian:bookworm-slim - Remove stretch EOL workarounds (archive.debian.org sed, pgdg stretch) - Remove apt-transport-https (included in modern apt) PostgreSQL client is still installed from the official pgdg repo but pointing to bookworm-pgdg instead of stretch-pgdg (archive).
Odoo 19 is a Python 3 only codebase. Replace Python 2.7 with Python 3 and install all Odoo 19 runtime dependencies as native Debian packages instead of pulling them through pip. The list of python3-* packages mirrors the Depends/Recommends of odoo/odoo's debian/control at the 19.0 tag. Installing from apt gives us: - Consistent versions against the Bookworm Python 3.11 interpreter - Pre-compiled C extensions (no toolchain needed at runtime) - Security updates through unattended-upgrades Also installed: the fonts Odoo ships with for web assets and PDF rendering (fonts-dejavu-core, fonts-inconsolata, fonts-font-awesome, fonts-roboto-unhinted), and libjs-underscore for the web client. The build toolchain (gcc, *-dev) is kept for any pip package that still needs to compile at bootstrap time via fetchreqs.
Since Debian 12 (PEP 668), pip can no longer install into the system Python; it errors out with "externally-managed-environment". The 10.0 image relied on pip install --user which is now blocked. Create a dedicated virtualenv at /opt/odoo/venv with --system-site-packages so it can reuse the python3-* packages already installed from apt (lxml, psycopg2, reportlab, gevent...) while still letting pip install additional tooling such as git-aggregator, click-odoo-contrib and openupgradelib on top. The venv is owned by the odoo user so that fetchbasereqs/fetchreqs can run as odoo without needing root. /opt/odoo/venv/bin is prepended to PATH so "python" and "pip" resolve to the venv binaries.
Odoo 10 used the less CSS preprocessor at runtime to compile web assets, which in turn required Node.js and the less npm package. Starting with Odoo 14 the web framework compiles SCSS natively via python3-libsass (already installed in the previous commit), so: - Node.js 6.x is no longer required at all - The less and less-plugin-clean-css npm packages are dropped Removing Node saves ~80 MB from the image and eliminates a dependency chain that has been stuck on a very old Node release (6.17.1) for years.
Odoo's PDF rendering requires wkhtmltopdf built against the patched Qt fork; the plain apt package from Debian (without patched Qt) produces broken headers, footers and tables. Use the official .deb built for bookworm from the wkhtmltopdf/ packaging releases. This is the last 0.12.x release (upstream is deprecated but remains the reference build for Odoo). Also switch from "dpkg -i" to "apt-get install ./wkhtml.deb" so that any transitive dependency declared by the .deb is resolved automatically instead of failing at install time.
Drop the Python 2 compatibility shims in the helper scripts: scripts/lib/common.sh pip_install() no longer passes --user. Under Debian 12+ (PEP 668), --user is blocked against the system Python, and we now run pip from /opt/odoo/venv instead (prepended to PATH in the Dockerfile), so packages are installed into the venv automatically. scripts/bin/genaddonspath.py Shebang changed from "#!/usr/bin/env python" to "#!/usr/bin/env python3". Removed the pipes.quote fallback; shlex.quote is available on all supported Python 3 versions.
config/defaults.env PYTHON_BIN now points to the venv interpreter (/opt/odoo/venv/bin/python). The venv sits first in PATH so bare "python" and "pip" resolve there too, but PYTHON_BIN is used explicitly by odoo_exec() to invoke odoo-bin. config/constraints.txt Reset to an empty (commented) file. The previous pins (python-stdnum<2.0, Unidecode<1.3, isodate<0.7, zeep<4) were Python 2 era constraints for Odoo 10 and no longer apply: Odoo 19 ships its own requirements.txt with much newer versions, and the base python3-* packages are already installed from apt. Instance-specific constraints can still be added to this file if an addon needs a particular version to be pinned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the docker-odoo image from the 10.0 branch to support Odoo 19.0.
Changes
Split into 7 reviewable commits:
python3-*packages mirroringodoo/odoo@19.0/debian/control, plus the fonts Odoo ships with./opt/odoo/venv(PEP 668) — Debian 12+ blockspip install --user. A venv with--system-site-packagesreuses apt-installedpython3-*while letting pip addgit-aggregator,click-odoo-contrib,openupgradelibon top.python3-libsass. Saves ~80 MB and drops a dead dependency chain.dpkg -itoapt install ./wkhtml.debfor transitive dep resolution.common.shdrops--user(pip now runs inside the venv);genaddonspath.pyshebang →python3and removes thepipes.quotefallback.PYTHON_BIN=/opt/odoo/venv/bin/python;constraints.txtreset (old pins were Python 2 era).Target Odoo version
Odoo 19.0. The image assumes
fetchcodewill populate${SRC_DIR}/odoowith the 19.0 branch via the instancerepos.yaml. Same bootstrap flow as the 10.0 image, just a different branch.Base OS / interpreter
debian:bookworm-slim(Debian 12)bookworm-pgdgTrixie was considered but ruled out because wkhtmltopdf only publishes
.debpackages for bookworm, and the openupgradelib classifiers don't explicitly cover Python 3.13 yet.Tooling versions (from PyPI / GitHub)
git-aggregator4.1 (explicit Python 3.13 support)openupgradelib— installed frommasterviagit+https://github.com/OCA/openupgradelib.git(last commit 2026-04-08)click-odoo-contrib— installed from PyPIInstance config format
Unchanged.
settings.env,repos.yamlandodoo.confstill use the same format as the 10.0 image. Only the content needs updating per instance (branch names, module lists, Odoo 19 options).Not yet tested
This PR is draft because the image has not been built yet. Next steps before flipping to ready-for-review:
docker buildthe image on node56 (/srv/docker/images/odoo-19.0)repos.yaml(justodoo/odoo@19.0)fetchcode,fetchreqs,genaddonspath)/web/database/selectorrespondswkhtmltopdf --versionreports the patched-Qt build/opt/odoo/venv(not~/.local)